Interview Question : to find a result array where ith element is the product of all other elements e

Posted by frictionlesspulley on Stack Overflow See other posts from Stack Overflow or by frictionlesspulley
Published on 2010-05-02T20:29:51Z Indexed on 2010/05/02 20:47 UTC
Read the original article Hit count: 103

There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1]. Solve it without division operator and in O(n).

© Stack Overflow or respective owner

Related posts about interview-questions

Related posts about algorithm